<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link type="text/css" rel="stylesheet" href="main.css">
    <style>
        table{
	        border-style: solid;
	        border-width: 1px;
	        border-color: black;
	        border-collapse: collapse;
        }
        .td-1{
		    text-align:center;
		    width:120px;
		    height:60px;
		    font-size: 16px;
		}
        .td-12{
		    text-align:center;
		    width:60px;
		    height:30px;
		    font-size: 16px;
		}
    </style>
    <title>专用航标的设置、撤除、位移和其他状况改变审批申请书</title>
    
	<!--jquery -->
	<script type="text/javascript" src="../js/jquery/jquery-2.0.3.min.js" ></script>
	
	<script type="text/javascript" src="../js/share.js"></script>
	<script type="text/javascript">

	var itemno = "";
	var applyid = "";
	var nodeno = "";
	var orgcode = "";
	var nextnodecode1 = "";
	var selectID = "userlist";
	var applyno = "";

	$(function(){
		applyno = getUrlParam("applyno");
		bindApply(applyno);
	});


	function bindApply(applyno){
		$.ajax({ 
			url: basePath() + 'business/getapplyinfo.do',
			data: {"applyno": applyno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonApply = data.datas;
		    		
		    		bindApplyForm(jsonApply);
		    		
		    		//绑定业务资料
		    		bindBusinessForm(jsonApply['applyid'], jsonApply['itemno']);
//		    		//绑定附件材料
					bindMaterialListForm(jsonApply['applyid']);

// // 					绑定受理数据
// 					bindAcceptForm(jsonApply['applyid']);
		    	}
	      	}
		});
	}

	function bindApplyForm(jsonApply){
		$('#proposer').html(jsonApply['proposer']);
		$('#company1').html(jsonApply['company']);
		
		for(var d in jsonApply){//遍历json对象的每个key/value对,p为key
			if(d == 'applytime'){
				$('#' + d).html(formatDate(jsonApply[d], 'yyyy年mm月dd日'));
			}
			else if(d == 'nodename'){
				if(jsonApply[d] == '办结')
					$('#' + d).html('<span style="color:green;font-weight: bold;">' + jsonApply[d] + '</span>');
				else if(jsonApply[d].indexOf('补正') >= 0){
					$('#' + d).html('<span style="color:red;font-weight: bold;">' + jsonApply[d] + '</span>');
					$('#correction').show();
					$('#correction').attr('href', 'correction.html?applyno=' + applyno);
				}
				else if(jsonApply[d].indexOf('申报') >= 0){
					$('#' + d).html('<span style="color:red;font-weight: bold;">未提交</span>');
					$('#edit').show();
					$('#edit').attr('href', 'edit.html?applyno=' + applyno);
				}
	        	else if(jsonApply[d].indexOf('受理') >= 0)
	        		$('#' + d).html('<span style="color:blue; font-weight: bold;">待受理</span>');
				else{
					$('#' + d).html('<span style="color:blue;font-weight: bold;">已受理</span>');
				}
			}
			else{
				$('#' + d).html(jsonApply[d] == '' ? '/' : jsonApply[d]);
			}
		}
	}

	function bindBusinessForm(applyid, itemno){

		$.ajax({ 
			url: basePath() + 'business/getbusinessinfo.do',
			data: {"applyid": applyid, "itemno": itemno},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonBusiness = data.datas;
		    		for(var d in jsonBusiness){//遍历json对象的每个key/value对,p为key
		    			$('#' + d).html(jsonBusiness[d] == '' ? '/' : jsonBusiness[d]);
		    		}
		    	}
	      	}
		});
	}

	function bindMaterialListForm(applyid){

		$.ajax({ 
			url: basePath() + 'business/getmaterialinfo.do',
			data: {"applyid": applyid},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonMaterial = data.datas;

					var k = 1;
					for(var i = 0; i < jsonMaterial.length; i++){
						var materialname = jsonMaterial[i]['materialname'];
						
						var fileid=jsonMaterial[i]['fileid']
						if('' != fileid){
							var materialnameHmtl = k + '、' + materialname + '<br />';
							$('#material').append(materialnameHmtl);
							k++;
						}
					}
		    	}
	      	}
		});
	}
	
	function bindAcceptForm(applyid){

		$.ajax({ 
			url: basePath() + 'business/getacceptinfo.do',
			data: {"applyid": applyid},
			dataType: "json",
	        contentType: "application/json",
			success: function(data){
		    	if(data.result == 1){
		    		var jsonAccept = data.datas;
		    		
					for(var d in jsonAccept){//遍历json对象的每个key/value对,p为key

		    			if(d == 'audittime'){
		    				$('#' + d).html(formatDate(jsonAccept[d], 'yyyy年mm月dd日'));
		    			}
		    			else{
		    				$('#' + d).html(jsonAccept[d] == '' ? '/' : jsonAccept[d]);
		    			}
		    		}
		    	}
	      	}
		});
	}
	</script>
</head>
<body>
<h1 >专用航标的设置、撤除、位移和其他状况改变审批申请书</h1>
<table border="1"  align="center" cellspacing="0" cellpadding="0">
    <tr>
        <td rowspan="2" style="text-align: center;width:  50px;">申请<br/>单位</td>
        <td class="td-12">姓&nbsp;名</td>
        <td>
			<span id="company" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
        <td  class="td-12">联系人</td>
        <td >
			<span id="proposer" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td  class="td-12">地&nbsp;址</td>
        <td>
        	<span id="contactaddr" style="font-size: 16px; margin-left: 15px;"></span>
        </td>
        <td  class="td-12">电&nbsp;话</td>
        <td >
        	<span id="mobilephone" style="font-size: 16px; margin-left: 15px;"></span>
        </td>
    </tr>
    <tr>
        <td class="td-1" colspan="2">工程名称</td>
        <td class="td-2" colspan="4" style="text-align: left;">
			<span id="engineeringname" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1" colspan="2">项目来源</td>
        <td class="td-2" colspan="4" style="text-align: left;">
			<span id="projectsource" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1" colspan="2">设置规模</td>
        <td class="td-2" colspan="4" style="text-align: left;">
			<span id="scale" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1" colspan="2">工程投资</td>
        <td class="td-2" colspan="4" style="text-align: left;">
			<span id="investment" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1" colspan="2">预定工期</td>
        <td class="td-2" style="text-align: left;" colspan="4">
			<span id="days" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1" colspan="2">设计单位</td>
        <td class="td-2" style="text-align: left;" colspan="4">
			<span id="buildunitname" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1" colspan="2">施工单位</td>
        <td class="td-2" style="text-align: left;" colspan="4">
			<span id="workunitname" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
        <td class="td-1" colspan="2">维护单位</td>
        <td class="td-2" style="text-align: left;" colspan="4">
			<span id="maintainname" style="font-size: 16px; margin-left: 15px;"></span>
		</td>
    </tr>
    <tr>
		<td class="td-3" colspan="2">提交材料</td>
		<td class="td-2" style="text-align: left;" colspan="4">
			<span id="material" style="font-size: 16px; margin-left: 5px;"></span>
		</td>
	</tr>
	<tr>
		<td class="td-1" colspan="2">申请单位</td>
        <td colspan="4" valign="top" align="left" style="height: 150px;font-size: 16px;">
			<div style="font-size: 16px;font-family: 'Adobe 宋体 Std L';padding: 55px 10px 20px 100px;">（盖章）：<span id="company1"><span/></div>
            <p id="applytime" style="font-size: 16px;font-family: 'Adobe 宋体 Std L';margin-right: 20px;text-align: right;">2018年06月25日</p>
        </td>
    </tr>
</table>
<div style="text-align: center;">
	<span style="font-size: 16px;">（本表一式二份）</span>
</div>
</body>
</html>